package dryven.view.components;

import java.io.Writer;

import dryven.view.ViewDataDictionary;
import dryven.view.engine.component.MultiThreadViewComponent;
import dryven.view.engine.component.ViewComponent;
import dryven.view.engine.component.annotations.ChildZones;
import dryven.view.engine.component.annotations.ComponentAttribute;
import dryven.view.engine.component.childzone.ChildZoneBindings;
import dryven.view.engine.component.childzone.ChildZoneCallback;
import dryven.view.engine.component.childzone.DefaultChildZoneStrategy;

public class If extends MultiThreadViewComponent {
	public void renderComponent(
			ViewDataDictionary localViewData, 
			Writer out, 
			ChildZoneBindings childZones, 
			@ComponentAttribute("test") Boolean value)
	{
		ChildZoneCallback childZone = childZones.getChildZoneCallback(ViewComponent.DefaultChildZone);
		if(value) {
			childZone.render(localViewData, out);
		}
	}

}
